{% if user.is_authenticated %}
	<!DOCTYPE html>
	<html lang="zh-CN">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <link rel="icon" href="/static/favicon.ico">
	    <meta name="description" content="">
	    <meta name="keyword" content="">
	    <meta name="author" content="root" >
	    <title>指纹识别</title>
	    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
	    <link rel="stylesheet" type="text/css" href="/static/style.css">
	</head>
	<body>
	{% include 'header.html'%}

	<div class="container text-center banner">

	    <!-- 扫描面板-->
	    <div class="panel panel-primary">
	          <div class="panel-heading">
	            <h3 class="panel-title">指纹识别</h3>
	          </div>
	          <div class="panel-body">
	                <!-- 扫描字段 -->
	                <form class="form-inline" role="form" method="POST" action="" id="lan">
	                  <div class="form-group">
	                    <label >WEB地址(http/https):</label> &nbsp;&nbsp;
	                    <input type="text" class="form-control" name="url" id="url"  value="http://baidu.com">
	                  </div>
					  &nbsp;&nbsp;&nbsp;&nbsp;
	                  <!--
					  <button type="submit" class="btn btn-default" onclick="submit_scan()">Start</button>
					  -->
					  <button type="button" class="btn btn-default" onclick="submit_scan()">识别</button>
	                </form>
	          </div>
	    </div>
	    <!-- 扫描面板结束 -->

	<!-- 动态添加数据 - 服务 -->
	<table class="table table-hover" id="info_server">
	</table>
	<!-- 动态添加数据 - 域名 -->
	<table class="table table-hover" id="info_domain">
	</table>

	</div>


	{% include 'footer.html' %}
	<!-- js引用-->
	<script src="/static/js/jquery.min.js"></script>
	<script src="/static/js/bootstrap.min.js"></script>

	<script type="text/javascript">
	//异步刷新
	function submit_scan(){
		//获取表单值
		var url = $("#url").val();

		//添加服务
		$("#info_server").html("<tr><th>相关服务识别</th></tr>");
		$.ajax({ url: "?action=get_web_server&url=" + url,dataType:'json', success: function(data){
			////console.log(data);
			//$("#info_server").html("<tr><th>扫描项</th><th>结果</th></tr>");
			$.each(data,function(index,content){
				//alert(content.url);
				//alert(1);
				//console.log(content.key);
				$("#info_server").append(
					"<tr><td>" + content.key + "</td><td>" + content.vaule + "</td></tr>" + "" );
			});
      }});

		//添加相关域名
		$("#info_domain").html("<tr><th>相关联域名</th></tr>");
		$.ajax({ url: "?action=get_web_site&url=" + url,dataType:'json', success: function(data){
			////
			console.log(data);
			$.each(data,function(index,content){
				//alert(content.url);
				//alert(1);
				//console.log(content.key);
				$("#info_domain").append(
					"<tr><td>" + content + "</td></tr>" + "" );
			});
      }});

	}
	</script>

	</body>
	</html>
{% else %}
<script>window.location.href="{% url 'login' %}";</script> 
{% endif %}